﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WeiXinDemo
{
    public partial class WeiXinTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            WeiXinSDK.WeiXinAPI.DeleteMenu();
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            WeiXinSDK.DataModel.Menu menu = new WeiXinSDK.DataModel.Menu();
            menu.button = new List<WeiXinSDK.DataModel.Button>();

            menu.button.Add(new WeiXinSDK.DataModel.Button()
            {
                ButtonType = WeiXinSDK.DataModel.Enum.ButtonType.Click,
                key = "test",
                name = "点击我",
            });

            menu.button.Add(new WeiXinSDK.DataModel.Button()
            {
                ButtonType = WeiXinSDK.DataModel.Enum.ButtonType.View,
                key = "baidu",
                name = "百度",
                url = "http://www.baidu.com"
            });


            WeiXinSDK.WeiXinAPI.CreateMenu(menu);
        }
    }
}